package com.zs4sdk.entity;

import org.json.JSONObject;

import com.common.library.entity.JSONResultEntity;
import com.common.library.util.Helper;

/**
 * 
 * 
 * function: PP信用支付JSON返回类
 * 
 * @ author:LiPeng 2014-3-21 上午11:02:16
 */
public class PPCreditJSONResultEntity extends JSONResultEntity {
	
	public static final String COLUM_STATUS = "status";
	
	private String status ;
	
	/*
	 * 构造方法
	 */

	public PPCreditJSONResultEntity(){
		
	}
	
	/*
	 * 构造方法
	 * @param json
	 */
	public PPCreditJSONResultEntity(JSONObject json){
		this.fromJSON(json);
	}
	
	/*
	 * 构造方法
	 * @param jsonStr
	 */
	public PPCreditJSONResultEntity(String jsonStr){
		try {
			this.fromJSON(new JSONObject(jsonStr));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	//#endregion 构造方法

	//#region Override方法
	@Override
	public JSONObject toJSON(){
		JSONObject result = super.toJSON();
		try {
			result.put(COLUM_STATUS, this.status);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return result;
	}
	
	@Override
	public void fromJSON(JSONObject json){
		super.fromJSON(json);
		if(Helper.isNotEmpty(json)){
			this.status = json.optString(COLUM_STATUS);
		}
	}
	
	public PPCreditJSONResultEntity(PPCreditJSONResultEntity entity){
		this.status = entity.getStatus();
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	
}
